﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tencent.OA.App
{
    /// <summary>
    /// 日志提供类。
    /// </summary>
    public class LoggerProvider
    {
        /// <summary>
        /// 日志记录器
        /// </summary>
        private static ILogger _current;
        private static object lockObj = new object();
        /// <summary>
        /// 返回日志记录对象的实例
        /// </summary>
        public static ILogger CurrentLogger
        {
            get
            {
                //根据配置文件，实例化   Ilogger
                return Instance;
            }
        }
        /// <summary>
        /// 日志记录器的单实例
        /// </summary>
        private static ILogger Instance 
        {
            get
            {
                lock (lockObj)
                {
                    if (_current == null)
                    {
                        _current = new Log4Net();
                    }
                }
                return _current;
            }           
        }
    }
}
